module ReadIndentedLisp
( ril
) where
import MyData.Form
import Lex
import LexerCombinator

syn = synDot . synCMC "'`" "SOLOMAGIC" . synAMC "'" "ATOMMAGIC"
ril = groupIndent0 (nil,id,id,cLeading,cGE) nil . filter nonBlank . (withIndent0 $ syn . fst . lexAMAP)
cLeading (C x (A "")) sub = C x sub
cLeading (C x (C y (A ""))) sub = C x $ C y sub
cLeading f sub = C f sub
cGE (C a (A "")) result = C a result
cGE f result = C f result
nonBlank (indent,lineform@(A _)) = False
nonBlank (indent,lineform@(C _ _)) = True

test = pr . ril